package com.example.helloapi;

public class GreeterImpl extends GreeterGrpc.GreeterImplBase{
    @Override
    public void sayHello(GreeterOuterClass.HelloRequest request,
        io.grpc.stub.StreamObserver<GreeterOuterClass.HelloReply> responseObserver) {
            String requestId = request.getName();
        
        // 处理请求，生成响应
        GreeterOuterClass.HelloReply response = GreeterOuterClass.HelloReply.newBuilder()
                .setMessage("Hello this is a response, " + requestId)
                .build();

        // 返回响应
        responseObserver.onNext(response);
        responseObserver.onCompleted();
        }
}